/* 定义全局样式变量 */
:root {
  --Ga1: #ffffff;
  --Ga2: #e5e5e5;
  --Ga3: #cccccc;
  --Ga7: #666666;
  --Ga10: #333333;
  --search-box-bg-gray: #f0f0f0; /* 搜索框默认灰色背景 */
  --search-box-bg-white: #ffffff; /* 搜索框悬浮白色背景 */
  --search-content-bg-click: #f5f5f5; /* 搜索内容点击后的背景色 */
}

/* 重置默认样式，确保跨浏览器一致性 */
article, aside, blockquote, body, button, code, dd, details, div, dl, dt, fieldset, figcaption, figure, footer, form, h1, h2, h3, h4, h5, h6, header, hgroup, hr, input, legend, li, menu, nav, ol, p, pre, section, td, textarea, th, ul {
  margin: 0;
  padding: 0;
}
div {
  display: block;
  unicode-bidi: isolate;
}

/* 设置body的默认字体 */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

input[type="text"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border: none;
  outline: none;
  background: transparent;
}

button {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

svg:not(:root) {
  overflow: hidden;
  overflow-clip-margin: content-box;
}

/* 通用容器样式
* 设置应用容器的高度，确保页面布局的灵活性
*/
#cheese-pages-app {
  height: auto !important;
}

/* 搜索栏样式 */
.search-container {
  height: 40px;
  position: relative;
  margin: 0 auto;
  max-width: 422px;
  z-index: 1;
}

/* 搜索栏
* 设置搜索栏的尺寸、背景颜色、边框和圆角
* 并添加悬浮时的背景颜色过渡效果
*/
.search__bar {
  height: 41.6px;
  width: 422px;
  background-color: var(--search-box-bg-gray);
  border: 1px solid var(--Ga2);
  border-radius: 8px;
  transition: background-color 0.3s;
}

.search__bar:hover {
  background-color: var(--search-box-bg-white);
}

/* 搜索表单
* 采用 flex 布局，使表单内元素水平居中对齐
* 设置表单的内边距和宽度
*/
#nav-searchform {
  display: flex;
  align-items: center;
  padding: 0 12px;
  height: 100%;
  width: 100%;
}

/* 搜索内容区域
* 设置搜索内容区域的尺寸和背景颜色过渡效果
* 点击时添加特定的背景颜色
*/
.search-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 374.4px;
  height: 32px;
  transition: background-color 0.3s;
}

.search-content.clicked {
  background-color: var(--search-content-bg-click);
}

/* 搜索输入框
* 弹性布局占满剩余空间
* 设置输入框的字体颜色、大小、行高和内边距
*/
.search-input {
  flex: 1;
  color: var(--Ga7);
  font-size: 14px;
  line-height: 20px;
  padding-right: 8px;
  width: 355.2px;
  height: 20px;
}

/* 清除按钮
* 设置清除按钮的尺寸、显示方式和对齐方式
* 仅在有输入内容时显示
*/
.nav-search-clean {
  width: 16px;
  height: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
}

/* 搜索按钮样式 */
.search-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--Ga10);
  border-radius: 6px;
  transition: background-color 0.3s;
}

.search-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* 页面布局
* 设置页面主要区域的宽度
*/
.pager-wrp,
.search-wrp {
  width: 1233px;
}

/* 搜索区域
* 设置搜索区域的宽度、内边距、最小高度和居中显示
*/
.search-wrp {
  width: 80%;
  padding: 20px;
  min-height: 600px;
  margin: 0 auto;
}

/* 搜索模块
* 设置搜索模块的宽度和居中显示
*/
.search-module {
  width: 422px;
  margin: 0 auto 34px;
}    

.search-container .search__bar.is-focus {
  border-radius: 8px;
}

.search-panel {
  width: 100%;
  margin-top: 10px;
  min-width: 236px;
  max-height: 612px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #e3e5e7;
  box-shadow: 0 0 30px rgba(0,0,0,.1);
  border-top: none;
  border-radius: 8px;
  padding: 13px 0 16px;
  -webkit-font-smoothing: antialiased;
}

.header {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: center;
  align-items: center;
  -ms-flex-pack: justify;
  justify-content: space-between;
  padding: 0 16px;
}

.header .title {
  height: 24px;
  font-size: 16px;
  line-height: 24px;
  color: var(--Ga10);
}

.header .clear {
  font-size: 12px;
  line-height: 15px;
  height: 15px;
  color: #9499a0;
  cursor: pointer;
}

.histories-wrap {
  padding: 0 16px;
  overflow: hidden;
}

.histories {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  margin-top: 12px;
  margin-right: -10px;
  margin-bottom: 4px;
}

.histories .history-item {
  position: relative;
  box-sizing: border-box;
  height: 30px;
  padding: 7px 10px 8px;
  font-size: 12px;
  line-height: 15px;
  background:#f6f7f8;
  border-radius: 4px;
  margin-right: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  color: #18191c;
}

.histories .history-item .history-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 96px;
}

.histories .history-item .close {
  display: none;
  box-sizing: border-box;
  position: absolute;
  width: 16px;
  height: 16px;
  top: -6px;
  right: -6px;
  padding: 2px;
}

.histories .history-item .close {
  display: none;
  box-sizing: border-box;
  position: absolute;
  width: 16px;
  height: 16px;
  top: -6px;
  right: -6px;
  padding: 2px;
}

.histories .history-item .close svg {
  width: 14px;
  height: 14px;
  fill: #ccc;
}

.history-item:hover .close {
  display: block;
}

/* 清空按钮悬浮样式 */
.history .clear:hover {
  color: #02aaaa;
  cursor: pointer;
}

/* 确保 search-panel 在 isClicked 为 true 时显示 */
.search-panel {
  display: none;
  position: absolute;
  background-color: white;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.search__bar.is-focus .search-panel {
  display: block;
}
